package org.example.spring_blog.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.example.spring_blog.model.UserInfo;

@Mapper
public interface UserInfoMapper {
    /**
     * 根据用户名查询用户信息
     * @param userName
     * @return
     */
    @Select("select id,user_name,password,github_url from user where delete_flag!=1 and user_name=#{userName}")
    UserInfo selectByName(String userName);


    /**
     * 根据id查询用户信息
     * @param id
     * @return
     */
    @Select("select id,user_name,password,github_url from user where delete_flag!=1 and id=#{id}")
    UserInfo selectById(Integer id);
}
